{include file="public:header" /}
<!--角色列表-->
<div class="pad_lr_10">
    <div class="J_tablelist table_list" data-acturi="{:url('Role/ajaxEdit')}">
        <table width="100%" cellspacing="0" id="J_cate_tree">
            <thead>
            <tr>
                <th width="30"><input type="checkbox" name="checkall" class="J_checkall"></th>
                <th width="60"><span data-tdtype="order_by" data-field="id">ID</span></th>
                <th align="left">角色名称</th>
                <th width="150">操作</th>
            </tr>
            </thead>
            <tbody>
            {volist name="list" id="val"}
                <tr>
                <td align="center"><input type="checkbox" class="J_checkitem" value="{$val.id}"></td>
                <td align="center">{$val.id}</td>
                <td align="left"> {if condition="$val['id'] neq $roleid and $roleid neq $superroleid"}{$val.title}{else /}<span data-tdtype="edit" data-field="title" data-id="{$val.id}" class="tdedit">{$val.title}</span>{/if}</td>
                <td align="center">
                    {if condition="$val['id'] eq $roleid or $val['id'] eq $superroleid"}
                        无权限 | 无权限
                        {else /}
                        <a href="javascript:;" class="J_showdialog" data-uri="{:url('Role/editmenu', ['id'=>$val['id']])}" data-title="设置菜单权限"  data-id="edit" data-width="500" data-height="410">菜单权限</a> |
                        <a href="javascript:void(0);" class="J_confirmurl" data-uri="{:url('Role/delete', ['id'=>$val['id']])}" data-acttype="ajax" data-msg="{:sprintf('确定删除%s角色么？',$val['title'])}">删除</a></td>
                    {/if}
                       </tr>
            {/volist}

            </tbody>
        </table>
    </div>
    <div class="btn_wrap_fixed">
        <label class="select_all"><input type="checkbox" name="checkall" class="J_checkall">全选/取消</label>
        <input type="button" class="btn" data-tdtype="batch_action" data-acttype="ajax" data-uri="{:url('Role/delete')}" data-name="id" data-msg="确认删除所选记录么？" value="删除" />
    </div>
</div>
{include file="public:footer" /}
<script src="__PUBLIC__/js/plugins/jquery.treetable.js"></script>
<script>
    $(function(){
        //initialState:'expanded'
        $("#J_cate_tree").treeTable({indent:20,treeColumn:1});
        $(".J_preview").preview();
    });
</script>
</body>
</html>